#include <cv.h>
#include <highgui.h>

int main()
{
	IplImage* image;
	IplImage* gray;

	image = cvLoadImage("t9t9.jpg", CV_LOAD_IMAGE_COLOR);

	if(image != 0)
	{
		gray = cvCreateImage(cvGetSize(image),IPL_DEPTH_8U,1);
		cvCvtColor(image,gray,CV_RGB2GRAY);
		cvNamedWindow( "T9-viewer", CV_WINDOW_AUTOSIZE);
		cvShowImage( "T9-viewer", gray);

		cvWaitKey(0);

		cvReleaseImage( &image );
		cvReleaseImage( &gray );

		cvDestroyWindow( "T9-viewer" );
	}

	return 0;

}